package com.demo.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.*;
import org.springframework.jdbc.datasource.DriverManagerDataSource;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;

import javax.sql.DataSource;

/**
 * @ClassName Jdbc
 * @Description TODO
 * @Author Windy
 * @Date 2022/9/2 14:24
 * @Version 1.0
 **/
//@Configuration
////@PropertySource("classpath:jdbc.properties")
////@Import(TranTemplate.class)
////@ComponentScan(basePackages = {"com.demo"})
//@EnableTransactionManagement
//@EnableAspectJAutoProxy
//@EnableWebMvc // 实现SpringMVC功能
public class JdbcConfig {
//    @Value("${jdbc.driver}")
//    private String driver;
//    @Value("${jdbc.url}")
//    private String url;
//    @Value("${jdbc.username}")
//    private String username;
//    @Value("${jdbc.password}")
//    private String password;
//
//    @Bean("dataSource")
//    public DataSource dataSource(){
//        DriverManagerDataSource dataSource = new DriverManagerDataSource();
//
//        dataSource.setDriverClassName(driver);
//        dataSource.setUrl(url);
//        dataSource.setUsername(username);
//        dataSource.setPassword(password);
//        return dataSource;
//    }


}
